load("@rules_mypy//mypy:mypy.bzl", "mypy_cli")
load("//bazel:api.bzl", "modular_cc_binary", "modular_cc_library", "modular_py_binary", "modular_py_library", "requirement")
load(":gpu_toolchain_alias.bzl", "gpu_toolchain_alias")
load(":lib_toolchain.bzl", "lib_toolchain")

package(default_visibility = ["//visibility:public"])

exports_files([
    "load_bazel_tools.py",
    "lsan-suppressions.txt",
])

mypy_cli(
    name = "mypy_cli",
    mypy_requirement = requirement("mypy"),
    tags = ["no-mypy"],
    deps = [
        requirement("pydantic"),
    ],
)

filegroup(
    name = "mojo-filecheck-test",
    testonly = True,
    srcs = ["mojo-filecheck-test.sh"],
)

filegroup(
    name = "create_venv",
    testonly = True,
    srcs = ["create_venv.py"],
)

filegroup(
    name = "pytest_runner",
    testonly = True,
    srcs = ["pytest_runner.py"],
)

alias(
    name = "uv",
    actual = select({
        "//:linux_aarch64": "@uv_linux_aarch64//:uv",
        "//:linux_x86_64": "@uv_linux_x86_64//:uv",
        "@platforms//os:macos": "@uv_darwin_aarch64//:uv",
    }),
)

modular_py_binary(
    name = "mojodoc_json_to_markdown",
    srcs = ["mojodoc_json_to_markdown.py"],
    data = glob(["mojodoc-templates/**"]),
    deps = [
        requirement("jinja2"),
    ],
)

lib_toolchain(
    name = "lib_toolchain",
)

modular_py_library(
    name = "bazel_sitecustomize",
    srcs = [
        "sitecustomize.py",
    ],
    imports = ["."],
)

gpu_toolchain_alias(
    name = "current_gpu_toolchain",
)

modular_cc_library(
    name = "debugging_test_lib",
    srcs = ["debugging_test_lib.cpp"],
    hdrs = ["debugging_test_lib.h"],
    includes = ["."],
    tags = ["manual"],
)

modular_cc_binary(
    name = "debugging_test_bin",
    srcs = ["debugging_test_bin.cpp"],
    tags = ["manual"],
    deps = [":debugging_test_lib"],
)
